<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<f:view beforePhase="#{listUserManaged.initPage}">
<jsp:include page="header.jsp" />
	<h:form id="ADM002">
		<table class="tbl_input" border="0" width="75%" cellpadding="0"
			cellspacing="0">
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td>会員名称で会員を検索します。検索条件無しの場合は全て表示されます。</td>
			</tr>
			<tr>
				<td width="75%">
				<table class="tbl_input" cellpadding="4" cellspacing="0">
					<tr>
						<td class="lbl_left">氏名:</td>
						<td align="left"><h:inputText style="txtSearch"
							value="#{listUserManaged.fullName}" size="20"
							onfocus="this.style.borderColor='#0066ff';"
							onblur="this.style.borderColor='#aaaaaa';" /></td>
						<td></td>
					</tr>
					<tr>
						<td class="lbl_left">グループ:</td>
						<td align="left" width="80px"><h:selectOneListbox size="1"
							value="#{listUserManaged.groupId}">
							<f:selectItems value="#{listUserManaged.itemGroups}" />
						</h:selectOneListbox> <t:saveState value="#{listUserManaged.itemGroups}" /></td>
						<td align="left"><h:commandButton styleClass="btn" value="検索"
							action="#{listUserManaged.doSearch}" />&nbsp;<h:commandButton
							action="#{userManaged.doRegist}" value="新規追加" styleClass="btn" />
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		<!-- End vung dieu kien tim kiem -->
		<!-- Begin vung hien thi danh sach user -->
		<table class="tbl_list" border="1" cellpadding="4" cellspacing="0"
			width="75%">
			<tr class="tr2">
				<th align="center" width="5px">ID</th>
				<th align="left">氏名<c:if
					test="${listUserManaged.sortByFullName == null || listUserManaged.sortByFullName == 'ASC'}">
					<h:commandLink action="#{listUserManaged.doSort}" value="▲▽">
						<f:param name="sortByFullName" value="DESC"></f:param>
						<f:param name="sortType" value="full_name"></f:param>
					</h:commandLink>
				</c:if> <c:if test="${listUserManaged.sortByFullName == 'DESC'}">
					<h:commandLink immediate="true" action="#{listUserManaged.doSort}"
						value="△▼">
						<f:param name="sortByFullName" value="ASC" />
						<f:param name="sortType" value="full_name" />
					</h:commandLink>
				</c:if></th>
				<th align="left">生年月日</th>
				<th align="left">グループ</th>
				<th align="left">メールアドレス</th>
				<th align="left">電話番号</th>
				<th align="left">日本語能力 <c:if
					test="${listUserManaged.sortByCodeLevel == null || listUserManaged.sortByCodeLevel == 'ASC'}">
					<h:commandLink immediate="true" action="#{listUserManaged.doSort}"
						value="▲▽">
						<f:param name="sortByCodeLevel" value="DESC" />
						<f:param name="sortType" value="code_level" />
					</h:commandLink>
				</c:if> <c:if test="${listUserManaged.sortByCodeLevel == 'DESC'}">
					<h:commandLink immediate="true" action="#{listUserManaged.doSort}"
						value="△▼">
						<f:param name="sortByCodeLevel" value="ASC" />
						<f:param name="sortType" value="code_level" />
					</h:commandLink>
				</c:if></th>
				<th align="left">失効日 <c:if
					test="${listUserManaged.sortByEndDate == null || listUserManaged.sortByEndDate == 'ASC'}">
					<h:commandLink immediate="true" action="#{listUserManaged.doSort}"
						value="△▼">
						<f:param name="sortByEndDate" value="DESC" />
						<f:param name="sortType" value="end_date" />
					</h:commandLink>
				</c:if> <c:if test="${listUserManaged.sortByEndDate == 'DESC'}">
					<h:commandLink immediate="true" action="#{listUserManaged.doSort}"
						value="▲▽">
						<f:param name="sortByEndDate" value="ASC" />
						<f:param name="sortType" value="end_date" />
					</h:commandLink>
				</c:if></th>
				<th align="left" width="5%">点数</th>
			</tr>
			<t:dataList value="#{listUserManaged.lsUserDetailDto}" var="item">
				<tr>
					<td align="right"><h:commandLink value="#{item.userId}"
						action="#{userManaged.doDetail}">
						<f:param name="userId" value="#{item.userId}"></f:param>
					</h:commandLink></td>
					<td><h:outputText value="#{item.fullName}" /></td>
					<td align="center"><h:outputText value="#{item.birthday}">
						<f:convertDateTime pattern="yyyy/MM/dd" locale="vi_VN" type="date" timeZone="Asia/Jakarta" />
					</h:outputText></td>
					<td><h:outputText value="#{item.groupName}" /></td>
					<td><h:outputText value="#{item.email}" /></td>
					<td><h:outputText value="#{item.tel}" /></td>
					<td><h:outputText value="#{item.nameLevel}" /></td>
					<td align="center"><h:outputText value="#{item.endDate}">
						<f:convertDateTime pattern="yyyy/MM/dd" locale="vi_VN" type="date" timeZone="Asia/Jakarta" />
					</h:outputText></td>
					<td align="right"><h:outputText value="#{item.total}" /></td>
			</t:dataList>
			<t:saveState value="#{listUserManaged.lsUserDetailDto}" />
		</table>
		<!-- End vung hien thi danh sach user -->
		<!-- Begin vung paging -->
		<table>
			<tr>
				<td><h:outputText value="#{listUserManaged.strPaging}"
					escape="false">
				</h:outputText></td>
			</tr>
		</table>
		<!-- End vung paging -->
		<h:outputText value="#{listUserManaged.message}" styleClass="errMsg"></h:outputText>
	</h:form>
	<jsp:include page="footer.jsp" />
</f:view>
